﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.eforceglobal.crux.web.wrokflows.DTOs;
using com.eforceglobal.crux.web.wrokflows;

namespace com.eforcegloabal.crux.web.wrokflows
{
    public class WorkflowClassConverter
    {
        public static WorkflowInstanceInformation CopyWorkflowInstanceToWorkflowInstanceInformation(WorkflowInstance workflowInstance)
        {
            WorkflowInstanceInformation workflowInstanceInformation = new WorkflowInstanceInformation();
            workflowInstanceInformation.WorkflowInstanceId = workflowInstance.WorkflowInstanceId;
            workflowInstanceInformation.WorkflowName = workflowInstance.WorkflowName;
            workflowInstanceInformation.WorkflowType = workflowInstance.WorkflowType;
            workflowInstanceInformation.Comments = workflowInstance.Comments;
            workflowInstanceInformation.StateName = workflowInstance.StateName;
            workflowInstanceInformation.ActivityName = workflowInstance.ActivityName;
            workflowInstanceInformation.LastModifiedBy = workflowInstance.LastModifiedBy;
            workflowInstanceInformation.LastModifiedOn = workflowInstance.LastModifiedOn;
            
            return workflowInstanceInformation;
        }
        public static WorkflowInstanceInformation CopyWorkflowInstanceAuditTrailToWorkflowInstanceInformation(WorkflowInstanceAuditTrail workflowInstance)
        {
            WorkflowInstanceInformation workflowInstanceInformation = new WorkflowInstanceInformation();
            workflowInstanceInformation.WorkflowInstanceId = workflowInstance.WorkflowInstanceId;
            workflowInstanceInformation.WorkflowName = workflowInstance.WorkflowName;
            workflowInstanceInformation.WorkflowType = workflowInstance.WorkflowType;
            workflowInstanceInformation.Comments = workflowInstance.Comments;
            workflowInstanceInformation.StateName = workflowInstance.StateName;
            workflowInstanceInformation.ActivityName = workflowInstance.ActivityName;
            workflowInstanceInformation.LastModifiedBy = workflowInstance.LastModifiedBy;
            workflowInstanceInformation.LastModifiedOn = workflowInstance.LastModifiedOn;

            return workflowInstanceInformation;
        }
    }
}
